import { SearchBar } from 'antd-mobile'
import React,{ lazy } from 'react'
var Index = lazy(()=>import('../views/Index'))
var Login = lazy(()=>import('../views/Login'))
var Register = lazy(()=>import('../views/Register'))
var Collect = lazy(()=>import('../views/Collect'))
var Product = lazy(()=>import('../views/Product'))
var NotFound = lazy(()=>import('../views/NotFound'))
var Search = lazy(()=>import('../views/Search'))

var Home = lazy(()=>import('../views/index/Home'))
var Cate = lazy(()=>import('../views/index/Cate'))
var Goods = lazy(()=>import('../views/index/Goods'))
var Mine = lazy(()=>import('../views/index/Mine'))
var Shopcart = lazy(()=>import('../views/index/Shopcart'))

export default [
    {
        path:'/index',
        component:Index,
        children:[
            {
                path:'/index/home',
                component:Home,
                exact:true
            },
            {
                path:'/index/cate',
                component:Cate,
                exact:true
            },
            {
                path:'/index/goods',
                component:Goods,
                exact:true
            },
            {
                path:'/index/shopcart',
                component:Shopcart,
                exact:true
            },
            {
                path:'/index/mine',
                component:Mine,
                exact:true
            },
            {
                from:'/index',
                to:'/index/home',
                redirect:true
            },
            {
                component:NotFound
            },
        ]
    },
    {
        path:'/search',
        component:Search
    },
    {
        path:'/login',
        component:Login,
        exact:true
    },
    {
        path:'/register',
        component:Register
    },
    {
        path:'/collect',
        component:Collect
    },
    {
        path:'/product',
        component:Product
    },
    {
        from:'/',
        to:'/index',
        redirect:true
    },
    {
        component:NotFound
    }
]